package j06collections;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class J1 {
    public static void main(String[] args) {
        List<String> arr1 = Arrays.asList("aa","xx","bb","cc");

        ArrayList<String> arr2 = new ArrayList<>();
        Collections.addAll(arr2,"aa","ww","gg","hh");
//        System.out.println("arr2 = " + arr2);
//        arr2.clear();
        Collections.sort(arr2,(s1,s2)->s2.compareTo(s1));

        System.out.println("arr2 = " + arr2);
        System.out.println("=====");
        List<Integer> arr4 = new ArrayList<>();
        Collections.addAll(arr4,1,4,7,9);
        System.out.println(
                Collections.binarySearch(arr4,7)
        );
        System.out.println(Collections.max(arr4));//9
    }
}
